package cn.tedu.system.oa.base.convert;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.WriteConverterContext;
import com.alibaba.excel.metadata.data.WriteCellData;

import java.util.Objects;

public class StampStatusConverter implements Converter<Integer> {
    @Override
    public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) throws Exception {
        Integer value = context.getValue();
        if (Objects.equals(value, 1)) {
            return new WriteCellData<>("正常");
        }
        if (Objects.equals(value, 2)) {
            return new WriteCellData<>("封存");
        }
        if (Objects.equals(value, 3)) {
            return new WriteCellData<>("作废");
        }
        if (Objects.equals(value, 4)) {
            return new WriteCellData<>("遗失");
        }

        return new WriteCellData<>("其它");
    }

}
